<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

namespace HyperfTest\Cases;

use App\Service\FreeOrderTaskService;
use App\Service\GrandMatchService;
use App\Service\LogService;
use App\service\TaskCenterService;
use HyperfTest\HttpTestCase;

/**
 * @internal
 * @coversNothing
 */
class MyTest extends HttpTestCase
{
    public function test()
    {
        $userArr = [
            ['account' => 5, 'is_win' => 1],
//            ['account' => 6, 'is_win' => 1],
//            ['account' => 7, 'is_win' => 0],
//            ['account' => 8, 'is_win' => 1]
        ];
//        TaskCenterService::updateMjDayTask($userArr);
//        TaskCenterService::updateMjGrow($userArr);
//        LogService::info('updateMjFreeOrderTask', $userArr);
//        FreeOrderTaskService::updateMjFreeOrderTask($userArr);
//        $game_conf = config('game');
//        $key = $game_conf['djs_player'];
//        dd('expire', redis()->ttl($key));
//        dd('expire', redis()->expire($key, 50));
//        dd('expire', redis()->ttl($key));
//        $key = $game_conf['djs_wait_list'];
//        $room_no = 10002;
//        redis()->lRem($key, $room_no);
        $round_num = 9;
        $pre_prize = GrandMatchService::getPreStagePrize($round_num);
        dd('pre_prize', $pre_prize);
        $curr_prize = GrandMatchService::getRoundPrize($round_num);
        dd('curr_prize', $curr_prize);
        if (empty($curr_prize)) {
            // 下局奖励
            $next_prize_arr = GrandMatchService::getNextStagePrize($round_num);
            $next_prize = GrandMatchService::showPrize($next_prize_arr);
        } else {
            $curr_prize = GrandMatchService::showPrize($curr_prize);
        }
        dd('curr_prize', $curr_prize);
    }
}
